﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using TrainigWorkshop.Model;
using System.Data.SqlClient;

namespace TrainigWorkshop.DAL
{
   public class Factory : IFactory
    {
       private SqlConnection conn;
        public Factory()
        {
            string connectionString = ConfigurationManager.ConnectionStrings["SQLConnectionString"].ToString();
            conn = new SqlConnection(connectionString);
        }
        public IStudentRespository CreateStudent()
        {
            return new StudentRespository(conn);
        }
        public IClassRespository CreateClass()
        {
            return new ClassRespository(conn);
        }

    }
}
